<%@Page Language="C#"%>
<%@ Register TagPrefix="Wrox" TagName="PageHeader" Src="/ch7/global/pageheader.ascx"%>
<%@ Register TagPrefix="Wrox" TagName="PageFooter" Src="/ch7/global/pagefooter.ascx"%>
<%@ Import Namespace="System.IO" %>


<Wrox:PageHeader id="header" runat=server />
<script runat=server>

	Hashtable shoppingCart;

		class Product
		{

			public override int GetHashCode()
			{
				return 1;
			}


			public override bool Equals( Object c )
			{
				return true;
			}

		};


	class ShoppingCartItem
	{


		string _productName;
		int _quantityOrdered;

//		 public  override int GetHashCode()
//		{
//			return 1;
//		}

		public override bool Equals( object x )
		{
			return true;
		}
	}
	protected void Page_Load( object sender, EventArgs e )
	{


		/*


		ShoppingCartItem c1 = new ShoppingCartItem();
		ShoppingCartItem c2 = new ShoppingCartItem();

		Hashtable ourSession;
		ourSession = new Hashtable();


		ourSession[c1] = "Wrox";
		ourSession[c2] = "Press";

		foreach( DictionaryEntry entry in ourSession )
		{
			Response.Write("<BR>Key:" + entry.Key + " Value:" + entry.Value );
		}


		Session["key"] = "value";
		Response.Write("<P>value is " + Session["KEY"] );

		ourSession["key"] = "value";
		Response.Write("<P>value is " + ourSession["KEY"] );


*/
		Product a = new Product();
		Product b = new Product();

	
		Response.Write( a.GetHashCode() );
		Response.Write( "<BR>" );
		Response.Write( b.GetHashCode() );


		Hashtable Products = new Hashtable();

		Products[a] = a;
		Products[b] = b;

		Response.Write("<BR>");
		Response.Write( Products.Count );


	}

</script>

<Wrox:PageFooter id="footer" runat=server />